package com.woniuxy.tfss.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniuxy.tfss.entity.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CommentMapper extends BaseMapper<Comment> {
    /**
     * 根据订单id查询该订单的评分
     *
     * @param orderId
     * @return
     */
    @Select("select * from tfss_comment where orderid=#{orderId}")
    Comment getByOrderId(Integer orderId);

    /**
     * 根据骑手id查询该骑手的评分
     *
     * @param riderId
     * @return
     */
    @Select("select * from tfss_comment where riderid=#{riderId}")
    List<Comment> getByRiderId(Integer riderId);
}
